home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 1 / QRZ Ham Radio Callsign Database - December 1993.iso / ucsd / packet / tcpip / sun / sunosaxp.shr / if_ax.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  1.8 KB  |  74 lines

  1. #ifndef _if_ax_h_
  2. #define _if_ax_h_
  3.  
  4. #define AXIOGUNIT    _IOR(x, 111, int)        /* get unit number */
  5. #define AXIOSHADDR    _IOW(x, 112, struct ether_addr)    /* set ether_addr */
  6.  
  7. #define AXSTREAMNAME    "ax25"            /* streams module name */
  8. #define AXIFNAME    "ax"            /* interface name */
  9. #define    AX25MTU        1000            /* max ax25 packet size */
  10.  
  11. /* An ax25 address is encoded as a struct ether_addr so that it can fit
  12.  * in the arp tables.
  13.  *
  14.  *    encoding format in struct ether_addr
  15.  *     ________ ______ ______ ______ ______ ______ ______ _____
  16.  *    |   8    |  6   |  6   |  6   |  6   |  6   |  6   |  4  |
  17.  *    |________|______|______|______|______|______|______|_____|
  18.  *    
  19.  * The upper byte of ether_addr is set to 0x99.
  20.  *
  21.  * The next 6 6-bit fields are each filled with an ax25_addr.aa_c[] entry,
  22.  * shifted back to normal ASCII, and then offset from ASCII space
  23.  * (ie. aa_c[0] - ' ').
  24.  *
  25.  * The sid has values ASCII '0' -> ASCII '0'+15. ASCII '0' is subtraced and
  26.  * the low 4 bits of the ether_addr are set from that.
  27.  */
  28.  
  29. /* screw digipeaters */
  30. struct ax25_hdr {
  31.     u_char        ah_dst[7], ah_src[7];
  32.     u_char        ah_cmd;
  33.     u_char        ah_pid;
  34. };
  35.  
  36. /*
  37.  * AX25 commands. All others are tossed.
  38.  */
  39. #define    AX25CMD_UI        0x03        /* AX25 datagram */
  40.  
  41. /*
  42.  * AX25 Protocol IDs. All others are tossed.
  43.  */
  44. #define    AX25PID_IP        0xcc        /* ARPA IP */
  45. #define    AX25PID_ARP        0xcd        /* ARPA ARP */
  46.  
  47. /*
  48.  * AX25 ARP address types.
  49.  */
  50. #define    AX25_HARDTYPE        0x0003
  51. #define    AX25_IPTYPE        ((short)AX25PID_IP)
  52.  
  53. /*
  54.  * KISS framing. This is SLIP.
  55.  */
  56. #define    KISS_END        0xc0
  57. #define KISS_ESC        0xdb
  58. #define KISS_TEND        0xdc
  59. #define KISS_TESC        0xdd
  60.  
  61. /*
  62.  * KISS commands - first data byte inside the KISS packet.
  63.  */
  64. #define    KISS_DATA        0x00
  65. #define    KISS_TXDELAY        0x01
  66. #define    KISS_PERSISTANCE    0x02
  67. #define    KISS_SLOTTIME        0x03
  68. #define    KISS_TXTAIL        0x04
  69. #define    KISS_FULLDUPLEX        0x05
  70. #define    KISS_HARDWARE        0x06
  71. #define    KISS_QUIT        0xff
  72.  
  73. #endif /* _if_ax_h_ */
  74.